﻿using System;
using System.Collections.Generic;
using BIS.Portal.Core.Base;
using BIS.Portal.Core.Global;

namespace BIS.Portal.Modules.CMS
{
    public partial class CmsListOtherArticleExcludeListControl_Settings : ControlSettingBase
    {
        #region Load Settings
        public string SLTinHienThi
        {
            get { return GetControlSetting<string>(ModuleSettingNames.CmsListOtherArticleExcludeList.txtSLTin, PortalContext.LanguageAlias); }
        }
        public bool HienThiTieuDe
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeList.ddlTieuDe, PortalContext.LanguageAlias); }
        }
        public bool HienThiAnh
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeList.ddlHinhAnh, PortalContext.LanguageAlias); }
        }
        public bool HienThiMoTa
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeList.ddlHienThiMoTa, PortalContext.LanguageAlias); }
        }
        public bool HienThiLinkXemCT
        {
            get { return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeList.ddlLinkXemCT, PortalContext.LanguageAlias); }
        }

        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            loadData();
        }
        private void loadData()
        {
            txtSLTin.Text = SLTinHienThi;
            ddlTieuDe.SelectedIndex = HienThiTieuDe ? 0 : 1;
            ddlHinhAnh.SelectedIndex = HienThiAnh ? 0 : 1;
            ddlHienThiMoTa.SelectedIndex = HienThiMoTa ? 0 : 1;
            ddlLinkXemCT.SelectedIndex = HienThiLinkXemCT ? 0 : 1;
        }
        public override void SaveSettings(Dictionary<string, string> settings)
        {
            SetControlSettingForAllLanguages(txtSLTin.ID, ModuleSettingNames.CmsListOtherArticleExcludeList.txtSLTin, settings);
            SetControlSettingForAllLanguages(ddlTieuDe.ID, ModuleSettingNames.CmsListOtherArticleExcludeList.ddlTieuDe, settings);
            SetControlSettingForAllLanguages(ddlHinhAnh.ID, ModuleSettingNames.CmsListOtherArticleExcludeList.ddlHinhAnh, settings);
            SetControlSettingForAllLanguages(ddlHienThiMoTa.ID, ModuleSettingNames.CmsListOtherArticleExcludeList.ddlHienThiMoTa, settings);
            SetControlSettingForAllLanguages(ddlLinkXemCT.ID, ModuleSettingNames.CmsListOtherArticleExcludeList.ddlLinkXemCT, settings);
        }
    }
}